package com.online.controller;

import com.faneui.common.utils.MapUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.online.dal.dao.OrderDAO;
import com.online.dal.dao.ProductDAO;
import com.online.dal.model.Order;
import com.online.dal.model.OrderDetail;
import com.online.dal.model.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("pay")
public class PayController {

    @Autowired
    private OrderDAO orderDAO;


    @RequestMapping(value = "", method = RequestMethod.GET)
    public ModelAndView pay(@RequestParam String orderId) throws Exception {
        ModelAndView mv = new ModelAndView("paySuccess");

        Order order= orderDAO.queryById(orderId);
        order.setStatus("已支付");
        orderDAO.updateById(order);
        return mv;
    }

}
